<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Admin extends MY_Controller {

	// 默认加载后台首页
	public function index()
	{
		$this->load->view('admin/index.html');
	}

	public function copy(){
		$this->load->view('admin/copy.html');
	}

	// 默认加载后台登录界面
	public function login(){
		$this->load->view('admin/login.html');
	}
	// 修改密码
	public function passwd(){
		$this->load->view('admin/passwd.html');
	}
	
//	//修改密码的动作
//	public function change_passwd(){
//		
//		$this->load->model('admin_model','admin');
//		
////		$username = $this->session->userdata('username');
////		$userData = $this->admin->check($username);	
//		
//		$username = $this->session->userdata('username');
//		$userData = $this->admin->check($username);
//
//		// p($userData);die;
//		$passwd = $this->input->post('password');
//		if($passwd != $userData[0]['password']) error('原始密码错误');
//		
//		
//		
////		$pw = $this->session->userdata('password');
////		
////		if($pw != $userData[0]['password']) error('原始密码错误');
//			
//		
//		$passwdF = $this->input->post('pswF');
//		$passwdS = $this->input->post('pswS');
//
//		if($passwdF != $passwdS) error('两次密码不相同');
//
//		
//		$uid = $this->session->userdata('uid');
//
//		$data = array(
//			'passwds'	=> $passwdF
//			);
//		$this->admin->change($data,$uid);
//
//		success('admin/admin/change', '修改成功');
//	}
}
